# _*_coding:utf-8_*_
__author__ = 'gerry'


#decorative device
def auth(func):#传入的是一个函数的地址
    def wrapper(args1):#参数传递
        user = raw_input("input passwd:").strip()
        if user == 'alex':
            print("------welcome login-------------")
            func(args1)
        else:
            print("---wrong passwd,access denied!---")
    return wrapper
@auth#装饰器，为程序的调用进行验证
def task(name):
    print "do sth....1 %s"%name

def task1():
    print("do sth....2")

def task2():
    print("do sth....3")
task("gerry")













